﻿
/**
*电话保护
*/
Chenxin.UI.ProtectionForm=Chenxin.extend(Chenxin.UI.FormCommon,{	
	actionUrl:'service/protectPhoneHandler.ashx',
	id:'protectionWin',
	renderTo:'jqm_protection',
	winCls:'',
	defBBtn:true,
	initFormValidator:function(){
		$("#protectPhone").formValidator({ validatorgroup: this.id,
	        onshow: "请输入电话！", onfocus: "请输入电话", oncorrect: " "
	    }).inputValidator({
	        min: 1, empty: { leftempty: false, rightempty: false, emptyerror: "电话不能为空!" }, onerror: "电话不能为空!"
	    })
	    //.functionValidator({ //电话验证
	    //    fun: function(val, elem) { return (val.isTel() || val.isMobile()); }, onerror: "请输入正确的电话"
	    //});
	},
	createForm:function(){
		// return formCommon.houseProtectionForm('protection');
		return Chenxin.FormCommon.houseProtectionForm('protection');
		
	},
	initEvent:function(){
		var _this=this;
		$('#protection_Save').live('click',function(){
			_this.save();
		});
		$('#protection_Cancle').live('click',function(){
			_this.hide();
		});	
	},
	initComponent:function(){
		Chenxin.UI.ProtectionForm.superclass.initComponent.call(this);
	}
});

/**
    *@description 电话保护表单
    *@comboIdPrefix DIV下拉框和提交按钮前缀
    */
Chenxin.FormCommon.houseProtectionForm=function(comboIdPrefix) {
    return '<table class="tbl_f  jqTabWh"><tbody><tr><th style="width:100px;">房源编号：</th><td id ="Protect_houseCode"><input type="text" name="HouseCode" inModel=false class="inputbox_n" /></td></tr> <tr><th>地址：</th><td id ="Protect_address"><input type="text" name="Address" inModel=false class="inputbox_n" /></td></tr><tr><th>所属人员：</th> <td id ="Protect_belongPerson"><input type="text" name="AddPerson" inModel=false class="inputbox_n" /></td></tr> <tr><th>所属门店：</th> <td id ="Protect_belongTdepartment"><input type="text" name="AddDepart" inModel=false class="inputbox_n" /></td></tr><tr><th>请输入保护电话：</th><td><div style="float:left;"><input type="text" maxlength="50" id="protectPhone" name="DisplayPhone" class="inputbox_n" /></div><div id="protectPhoneTip" style="float:left; margin-left: 5px; width: 80px; height: 26px; line-height: 26px; text-align: left;" class="fl"></div></td><th style=\"float:left;\">例：021-1234567或13588888888 </th></tr> </tbody></table>';
};